<table class="table">
  <thead>
    <tr>
      <th>Domain</th>
      <th>A Record</th>
      <th>DNS Status</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% service.domains.each do |domain| %>
      <tr id="<%= dom_id(domain) %>">
        <td><%= link_to domain.domain_name, "https://#{domain.domain_name}", target: "_blank" %></td>
        <td>
          <%= render(
            "shared/partials/async_renderer",
            view_model: Async::K8::ClusterIpViewModel.new(
              current_user,
              service_id: service.id
            )
          ) %>
        </td>
        <td>
          <%= render "projects/services/domains/status", domain: %>
        </td>
        <td>
          <%= link_to "Remove",
              project_service_domain_path(
                service.project,
                service,
                domain
              ),
              method: :delete,
              class: "btn btn-sm btn-ghost"
            %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
